<template>
  <div class="app-container">
    <el-button type="warning" plain @click="orderpay">金融测试支付</el-button>
    <div>
      租房分期
      <el-button type="warning" plain>修改租房分期产品</el-button>
      <el-button type="warning" plain @click="addRentalInstallment()">添加租房分期通道</el-button>
    </div>

    <el-table :data="rentingInfoList" height="250" style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column prop="jrProductName" label="产品名称" width="180"></el-table-column>
      <el-table-column prop="companyName" label="资方" width="180"></el-table-column>
      <el-table-column prop="bankName" label="账户信息" width="180"></el-table-column>
      <el-table-column prop="instalmentPeriod" label="分期期限" width="180">
        <template slot-scope="scope">
          {{scope.row.instalmentPeriod}}个月
        </template>
      </el-table-column>
      <el-table-column prop="repaymentType" label="还款方式" width="180">
        <template slot-scope="scope">
          {{scope.row.repaymentType==1?'按月还款':scope.row.repaymentType==2?'按季还款':'按租约周期支付'}}
        </template>
      </el-table-column>
      <el-table-column prop="creditLine" label="授信额度%" width="180"></el-table-column>
      <el-table-column prop="delFlg" label="审核状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.auditing==1">通过</span>
          <span v-if="scope.row.auditing==0">待审核</span>
          <span v-if="scope.row.auditing==2" style="color: red">驳回</span>
        </template>
      </el-table-column>
      <el-table-column prop="delFlg" label="状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.delFlg==true">正常</span>
          <span v-if="scope.row.delFlg==false" style="color: red">已作废</span>
        </template>
      </el-table-column>

      <el-table-column label="操作">
        <template slot-scope="scope">
        <el-link type="primary" @click="reloadProduct(scope.row)">查看</el-link>&#12288;
        <el-link type="primary" v-if="scope.row.delFlg==false" disabled>修改</el-link>&#12288;
        <el-link type="warning" v-if="scope.row.delFlg==true"  @click="updateProduct(scope.row)">修改</el-link>&#12288;
        <el-link type="primary" v-if="scope.row.delFlg==false" disabled>作废</el-link>&#12288;
        <el-link type="danger" v-if="scope.row.delFlg==true" @click="voidSoftDelete(scope.row.id)">作废</el-link>&#12288;

      </template>
      </el-table-column>

    </el-table>
    <div>
      收房贷
      <el-button type="warning" plain>修改收房贷产品</el-button>
      <el-button type="warning" plain @click="addHousingLoanCollection">添加收房贷通道</el-button>
    </div>

    <el-table :data="homeInfoList" height="250"  style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column prop="jrProductName" label="产品名称" width="180"></el-table-column>
      <el-table-column prop="companyName" label="资方" width="180"></el-table-column>
      <el-table-column prop="bankName" label="账户信息" width="180"></el-table-column>
      <el-table-column prop="instalmentPeriod" label="分期期限" width="180">
        <template slot-scope="scope">
          {{scope.row.instalmentPeriod}}个月
        </template>
      </el-table-column>
      <el-table-column prop="repaymentType" label="还款方式" width="180">
        <template slot-scope="scope">
          {{scope.row.repaymentType==1?'按月还款':scope.row.repaymentType==2?'按季还款':'按租约周期支付'}}
        </template>
      </el-table-column>
      <el-table-column prop="creditLine" label="授信额度%" width="180"></el-table-column>
      <el-table-column prop="delFlg" label="审核状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.auditing==1">通过</span>
          <span v-if="scope.row.auditing==0">待审核</span>
          <span v-if="scope.row.auditing==2" style="color: red">驳回</span>
        </template>
      </el-table-column>
      <el-table-column prop="delFlg" label="状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.delFlg==true">正常</span>
          <span v-if="scope.row.delFlg==false" style="color: red">已作废</span>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
        <el-link type="primary" @click="reloadHomeInfoList(scope.row)">查看</el-link>&#12288;
        <el-link type="primary" v-if="scope.row.delFlg==false" disabled>修改</el-link>&#12288;
        <el-link type="warning" v-if="scope.row.delFlg==true" @click="updateHomeInfoList(scope.row)">修改</el-link>&#12288;
        <el-link type="primary" v-if="scope.row.delFlg==false" disabled>作废</el-link>&#12288;
          <el-link type="danger" v-if="scope.row.delFlg==true" @click="voidSoftDelete(scope.row.id)">作废</el-link>&#12288;
        </template>
      </el-table-column>

    </el-table>
    <div>
      应收租约保理
      <el-button type="warning" plain>修改租约保理产品</el-button>
      <el-button type="warning" plain @click="addLeaseFactoringReceivable">添加租约保理通道</el-button>
    </div>

    <el-table :data="receivableInfoList" height="250"  style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column prop="jrProductName" label="产品名称" width="180"></el-table-column>
      <el-table-column prop="companyName" label="资方" width="180"></el-table-column>
      <el-table-column prop="bankName" label="账户信息" width="180"></el-table-column>
      <el-table-column prop="instalmentPeriod" label="分期期限" width="180">
        <template slot-scope="scope">
          {{scope.row.instalmentPeriod}}个月
        </template>
      </el-table-column>
      <el-table-column prop="repaymentType" label="还款方式" width="180">
        <template slot-scope="scope">
          {{scope.row.repaymentType==1?'按月还款':scope.row.repaymentType==2?'按季还款':'按租约周期支付'}}
        </template>
      </el-table-column>
      <el-table-column prop="creditLine" label="授信额度%" width="180"></el-table-column>
      <el-table-column prop="delFlg" label="审核状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.auditing==1">通过</span>
          <span v-if="scope.row.auditing==0">待审核</span>
          <span v-if="scope.row.auditing==2" style="color: red">驳回</span>
        </template>
      </el-table-column>
      <el-table-column prop="delFlg" label="状态" width="180">
        <template scope="scope">
          <span v-if="scope.row.delFlg==true">正常</span>
          <span v-if="scope.row.delFlg==false" style="color: red">已作废</span>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">

          <el-link type="primary" @click="reloadReceivableInfoList(scope.row)">查看</el-link>&#12288;
          <el-link type="primary" v-if="scope.row.delFlg==false" disabled>修改</el-link>&#12288;
          <el-link type="warning" v-if="scope.row.delFlg==true" @click="updateReceivableInfoList(scope.row)">修改</el-link>&#12288;
          <el-link type="primary" v-if="scope.row.delFlg==false" disabled>作废</el-link>&#12288;
          <el-link type="danger" v-if="scope.row.delFlg==true" @click="voidSoftDelete(scope.row.id)">作废</el-link>&#12288;
        </template>
      </el-table-column>

    </el-table>

    <el-dialog title="添加租房分期" :visible.sync="dialogFormVisibleRentalInstallment">
      <el-form :model="form">
        <el-form-item label="产品名称" >
          <el-input v-model="form.jrProductName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="form.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所"></el-option>
            <el-option label="应花" value="应花"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="分期期限" >
          <el-radio v-model="form.instalmentPeriod" :label="11" :value=11>11个月</el-radio>
          <el-radio v-model="form.instalmentPeriod" :label="23" :value=23>23个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="form.repaymentType" :label="1">按月还款</el-radio>

        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="form.creditLine" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="支付PC链接(URL)" >
          <el-input v-model="form.urlPayPc" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="支付移动链接(URL)" >
          <el-input v-model="form.urlPayMoble" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="补全信息PC(URL)" >
          <el-input v-model="form.urlAddDetailInfoPc" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="补全信息移动(URL)" >
          <el-input v-model="form.urlAddDetailInfoMobile" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="App下载(URL)" >
          <el-input v-model="form.urlAppDownload" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="账户类型" >
          <el-select v-model="form.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value="1"></el-option>
            <el-option label="对私账户" :value="2"></el-option>
          </el-select>
        </el-form-item>
    <div v-if="form.accountType=='1'||form.accountType=='2'">
      <el-form-item label="开户省份" >
        <el-select v-model="form.bankAccountProvince" placeholder="请选择">
          <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

        </el-select>
      </el-form-item>
      <el-form-item label="银行名称" >
        <el-select v-model="form.bankId" placeholder="请选择">
          <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

        </el-select>
      </el-form-item>
      <div v-if="form.accountType==1">
        <el-form-item label="开户支行" >
          <el-input v-model="form.openingBank" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="联行行号" >
          <el-input v-model="form.bankBranchCodeLh" autocomplete="off"></el-input>
        </el-form-item>
      </div>
      <el-form-item label="账户姓名" >
        <el-input v-model="form.accountName" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="银行卡号" >
        <el-input v-model="form.bankCardNumber" autocomplete="off"></el-input>
      </el-form-item>
    </div>

        <el-form-item label="申请条件" >
          <el-input v-model="form.applicationConditions" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="form.riskRequirement" autocomplete="off"></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="productSubmit()">确 定</el-button>
      </div>


    </el-dialog>
    //查看租房分期
    <el-dialog title="查看租房分期" :visible.sync="reloadDialogFormVisibleRentalInstallment">
      <el-form :model="form">
        <el-form-item label="产品名称" >
          <el-input v-model="form.jrProductName" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="form.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所" disabled></el-option>
            <el-option label="应花" value="应花" disabled></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="分期期限" >
          <el-radio v-model="form.instalmentPeriod" :label="11" :value=11 disabled>11个月</el-radio>
          <el-radio v-model="form.instalmentPeriod" :label="23" :value=23 disabled>23个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="form.repaymentType" :label="1" disabled>按月还款</el-radio>

        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="form.creditLine" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="支付PC链接(URL)" >
          <el-input v-model="form.urlPayPc" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="支付移动链接(URL)" >
          <el-input v-model="form.urlPayMoble" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="补全信息PC(URL)" >
          <el-input v-model="form.urlAddDetailInfoPc" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="补全信息移动(URL)" >
          <el-input v-model="form.urlAddDetailInfoMobile" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="App下载(URL)" >
          <el-input v-model="form.urlAppDownload" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="账户类型" >
          <el-select v-model="form.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value="1" disabled></el-option>
            <el-option label="对私账户" :value="2" disabled></el-option>
          </el-select>
        </el-form-item>
        <div v-if="form.accountType=='1'||form.accountType=='2'">
          <el-form-item label="开户省份" >
            <el-select v-model="form.bankAccountProvince" placeholder="请选择">
              <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

            </el-select>
          </el-form-item>
          <el-form-item label="银行名称" >
            <el-select v-model="form.bankId" placeholder="请选择">
              <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

            </el-select>
          </el-form-item>
          <div v-if="form.accountType==1">
            <el-form-item label="开户支行" >
              <el-input v-model="form.openingBank" autocomplete="off" readonly></el-input>
            </el-form-item>
            <el-form-item label="联行行号" >
              <el-input v-model="form.bankBranchCodeLh" autocomplete="off" readonly></el-input>
            </el-form-item>
          </div>
          <el-form-item label="账户姓名" >
            <el-input v-model="form.accountName" autocomplete="off" readonly></el-input>
          </el-form-item>
          <el-form-item label="银行卡号" >
            <el-input v-model="form.bankCardNumber" autocomplete="off" readonly></el-input>
          </el-form-item>
        </div>

        <el-form-item label="申请条件" >
          <el-input v-model="form.applicationConditions" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="form.riskRequirement" autocomplete="off" readonly></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="productSubmit()">确 定</el-button>
      </div>


    </el-dialog>

    <el-dialog title="添加收房贷" :visible.sync="dialogFormVisibleHousingLoanCollection">
      <el-form :model="housingLoanCollection">
        <el-form-item label="产品名称" >
          <el-input v-model="housingLoanCollection.jrProductName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="housingLoanCollection.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所"></el-option>
            <el-option label="应花" value="应花"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="贷款期限" >
          <el-radio v-model="housingLoanCollection.instalmentPeriod" :label="11">12个月</el-radio>
          <el-radio v-model="housingLoanCollection.instalmentPeriod" :label="23">24个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="housingLoanCollection.repaymentType" :label="1">按月还款</el-radio>
          <el-radio v-model="housingLoanCollection.repaymentType" :label="2">按季还款</el-radio>
        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="housingLoanCollection.creditLine" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="账户类型" >
          <el-select v-model="housingLoanCollection.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value="1"></el-option>
            <el-option label="对私账户" :value="2"></el-option>
          </el-select>
        </el-form-item>
        <div v-if="housingLoanCollection.accountType=='1'||housingLoanCollection.accountType=='2'">
          <el-form-item label="开户省份" >
            <el-select v-model="form.bankAccountProvince" placeholder="请选择">
              <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

            </el-select>
          </el-form-item>
          <el-form-item label="银行名称" >
            <el-select v-model="form.bankId" placeholder="请选择">
              <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

            </el-select>
          </el-form-item>
          <div v-if="housingLoanCollection.accountType==1">
            <el-form-item label="开户支行" >
              <el-input v-model="housingLoanCollection.openingBank" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="联行行号" >
              <el-input v-model="housingLoanCollection.bankBranchCodeLh" autocomplete="off"></el-input>
            </el-form-item>
          </div>
          <el-form-item label="账户姓名" >
            <el-input v-model="housingLoanCollection.accountName" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="银行卡号" >
            <el-input v-model="housingLoanCollection.bankCardNumber" autocomplete="off"></el-input>
          </el-form-item>
        </div>

        <el-form-item label="申请条件" >
          <el-input v-model="housingLoanCollection.applicationConditions" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="housingLoanCollection.riskRequirement" autocomplete="off"></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="housingLoanCollectionSubmit()">确 定</el-button>
      </div>
    </el-dialog>
    //查看收房贷
    <el-dialog title="查看收房贷" :visible.sync="reloadDialogFormVisibleHousingLoanCollection">
      <el-form :model="housingLoanCollection">
        <el-form-item label="产品名称" >
          <el-input v-model="housingLoanCollection.jrProductName" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="housingLoanCollection.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所" disabled></el-option>
            <el-option label="应花" value="应花" disabled></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="贷款期限" >
          <el-radio v-model="housingLoanCollection.instalmentPeriod" :label="11" disabled>12个月</el-radio>
          <el-radio v-model="housingLoanCollection.instalmentPeriod" :label="23" disabled>24个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="housingLoanCollection.repaymentType" :label="1" disabled>按月还款</el-radio>
          <el-radio v-model="housingLoanCollection.repaymentType" :label="2" disabled>按季还款</el-radio>
        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="housingLoanCollection.creditLine" autocomplete="off" readonly></el-input>
        </el-form-item>

        <el-form-item label="账户类型" >
          <el-select v-model="housingLoanCollection.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value="1" disabled></el-option>
            <el-option label="对私账户" :value="2" disabled></el-option>
          </el-select>
        </el-form-item>
        <div v-if="housingLoanCollection.accountType=='1'||housingLoanCollection.accountType=='2'">
          <el-form-item label="开户省份" >
            <el-select v-model="form.bankAccountProvince" placeholder="请选择">
              <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

            </el-select>
          </el-form-item>
          <el-form-item label="银行名称" >
            <el-select v-model="form.bankId" placeholder="请选择">
              <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

            </el-select>
          </el-form-item>
          <div v-if="housingLoanCollection.accountType==1">
            <el-form-item label="开户支行" >
              <el-input v-model="housingLoanCollection.openingBank" autocomplete="off" readonly></el-input>
            </el-form-item>
            <el-form-item label="联行行号" >
              <el-input v-model="housingLoanCollection.bankBranchCodeLh" autocomplete="off" readonly></el-input>
            </el-form-item>
          </div>
          <el-form-item label="账户姓名" >
            <el-input v-model="housingLoanCollection.accountName" autocomplete="off" readonly></el-input>
          </el-form-item>
          <el-form-item label="银行卡号" >
            <el-input v-model="housingLoanCollection.bankCardNumber" autocomplete="off" readonly></el-input>
          </el-form-item>
        </div>

        <el-form-item label="申请条件" >
          <el-input v-model="housingLoanCollection.applicationConditions" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="housingLoanCollection.riskRequirement" autocomplete="off" readonly></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="housingLoanCollectionSubmit()">确 定</el-button>
      </div>
    </el-dialog>



    <el-dialog title="添加应收租约保理" :visible.sync="dialogFormVisibleaddLeaseFactoringReceivable">
      <el-form :model="receivableInfoList">
        <el-form-item label="产品名称" >
          <el-input v-model="receivableInfoList.jrProductName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="receivableInfoList.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所"></el-option>
            <el-option label="应花" value="应花"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="贷款期限" >
          <el-radio v-model="receivableInfoList.instalmentPeriod" :label="11">12个月</el-radio>
          <el-radio v-model="receivableInfoList.instalmentPeriod" :label="23">24个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="receivableInfoList.repaymentType" :label="1">按租约周期支付</el-radio>

        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="receivableInfoList.creditLine" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="账户类型" >
          <el-select v-model="receivableInfoList.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value=1></el-option>
            <el-option label="对私账户" :value=2></el-option>
          </el-select>
        </el-form-item>
        <div v-if="receivableInfoList.accountType=='1'||receivableInfoList.accountType=='2'">
          <el-form-item label="开户省份" >
            <el-select v-model="form.bankAccountProvince" placeholder="请选择">
              <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

            </el-select>
          </el-form-item>
          <el-form-item label="银行名称" >
            <el-select v-model="form.bankId" placeholder="请选择">
              <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

            </el-select>
          </el-form-item>
          <div v-if="receivableInfoList.accountType==1">
            <el-form-item label="开户支行" >
              <el-input v-model="receivableInfoList.openingBank" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="联行行号" >
              <el-input v-model="receivableInfoList.bankBranchCodeLh" autocomplete="off"></el-input>
            </el-form-item>
          </div>
          <el-form-item label="账户姓名" >
            <el-input v-model="receivableInfoList.accountName" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="银行卡号" >
            <el-input v-model="receivableInfoList.bankCardNumber" autocomplete="off"></el-input>
          </el-form-item>
        </div>

        <el-form-item label="申请条件" >
          <el-input v-model="receivableInfoList.applicationConditions" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="receivableInfoList.riskRequirement" autocomplete="off"></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="leaseFactoringReceivableSubmit()">确 定</el-button>
      </div>
    </el-dialog>

    //查看应收租约保理

    <el-dialog title="添加应收租约保理" :visible.sync="reloadDialogFormVisibleLeaseFactoringReceivable">
      <el-form :model="receivableInfoList">
        <el-form-item label="产品名称" >
          <el-input v-model="receivableInfoList.jrProductName" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="资金方" >
          <el-select v-model="receivableInfoList.companyName" placeholder="请选择资金方">
            <el-option label="久金所" value="久金所" disabled></el-option>
            <el-option label="应花" value="应花" disabled></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="贷款期限" >
          <el-radio v-model="receivableInfoList.instalmentPeriod" :label="11" disabled>12个月</el-radio>
          <el-radio v-model="receivableInfoList.instalmentPeriod" :label="23" disabled>24个月</el-radio>
        </el-form-item>
        <el-form-item label="还款方式" >
          <el-radio v-model="receivableInfoList.repaymentType" :label="1" disabled>按租约周期支付</el-radio>

        </el-form-item>
        <el-form-item label="授信额度" >
          <el-input v-model="receivableInfoList.creditLine" autocomplete="off" readonly></el-input>
        </el-form-item>

        <el-form-item label="账户类型" >
          <el-select v-model="receivableInfoList.accountType" placeholder="请选择" >
            <el-option label="对公账户" :value=1 disabled></el-option>
            <el-option label="对私账户" :value=2 disabled></el-option>
          </el-select>
        </el-form-item>
        <div v-if="receivableInfoList.accountType=='1'||receivableInfoList.accountType=='2'">
          <el-form-item label="开户省份" >
            <el-select v-model="form.bankAccountProvince" placeholder="请选择">
              <el-option  v-for="city in province" :label="city.regionName" :value="city.regionId"></el-option>

            </el-select>
          </el-form-item>
          <el-form-item label="银行名称" >
            <el-select v-model="form.bankId" placeholder="请选择">
              <el-option v-for="bank in BankList" :label="bank.bankName" :value="bank.id"></el-option>

            </el-select>
          </el-form-item>
          <div v-if="receivableInfoList.accountType==1">
            <el-form-item label="开户支行" >
              <el-input v-model="receivableInfoList.openingBank" autocomplete="off" readonly></el-input>
            </el-form-item>
            <el-form-item label="联行行号" >
              <el-input v-model="receivableInfoList.bankBranchCodeLh" autocomplete="off" readonly></el-input>
            </el-form-item>
          </div>
          <el-form-item label="账户姓名" >
            <el-input v-model="receivableInfoList.accountName" autocomplete="off" readonly></el-input>
          </el-form-item>
          <el-form-item label="银行卡号" >
            <el-input v-model="receivableInfoList.bankCardNumber" autocomplete="off" readonly></el-input>
          </el-form-item>
        </div>

        <el-form-item label="申请条件" >
          <el-input v-model="receivableInfoList.applicationConditions" autocomplete="off" readonly></el-input>
        </el-form-item>
        <el-form-item label="风控要求" >
          <el-input v-model="receivableInfoList.riskRequirement" autocomplete="off" readonly></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="leaseFactoringReceivableSubmit()">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog
      title="请选择支付方式"
      :visible.sync="dialogVisiblePay"
      width="30%"
     >
      <div>
        支付方式:
        <el-radio-group v-model="payFormData.wayCode">
          <el-radio-button label="ALI_QR">支付宝二维码</el-radio-button>
          <el-radio-button label="ALI_PC">支付宝PC</el-radio-button>
        </el-radio-group>
      </div>

      金额:<el-input type="test" v-model="payFormData.amount"></el-input>
      <el-button type="success" @click="zf">支付</el-button>

      <span slot="footer" class="dialog-footer">

  </span>
    </el-dialog>

    <el-dialog
      title="请扫码支付"
      :visible.sync="dialogVisiblePayqr"
      width="30%"
    >
     <img :src="this.payQr" width="70px" height="70px">


      <span slot="footer" class="dialog-footer">

  </span>
    </el-dialog>

  </div>


</template>


<script>
import { listProduct,delProduct,addProduct,provinceList,getBankList,pay} from "@/api/financial/product";
import ReconnectingWebSocket from 'reconnectingwebsocket'

export default {
  name: "Info",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      dialogFormVisibleRentalInstallment:false,
      dialogFormVisibleHousingLoanCollection:false,
      dialogFormVisibleaddLeaseFactoringReceivable:false,
      reloadDialogFormVisibleRentalInstallment:false,
      reloadDialogFormVisibleHousingLoanCollection:false,
      reloadDialogFormVisibleLeaseFactoringReceivable:false,
      dialogVisiblePay:false,
      dialogVisiblePayqr:false,
      payFormData: {
        wayCode: 'ALI_PC',
        amount: 100,
        currency: 'CNY',
        subject: 'vue测试',
        body: 'vue描述',
        notifyUrl: 'http://43.142.52.7:9218/api/anon/paytestNotify/payOrder',
        payDataType: 'codeImgUrl'
      },
      //省
      province:[],
      //银行
      BankList:[],
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 楼盘信息表格数据
      rentingInfoList: [],
      homeInfoList: [],
      receivableInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,

      },
      // 表单参数
      form: {
        instalmentPeriod:'',
      },
      housingLoanCollection:{},
      leaseFactoringReceivable:{},
      // 表单校验
      rules: {
      },
      status:0,
    };
  },
  created() {
    this.rentList();
    this.getProvince();
    this.getBank();
  },
  methods: {
    /**
     * 查询金融产品管理列表
     * */
    rentList() {
      this.loading = true;
      listProduct().then(response => {
        this.rentingInfoList = response.data.rentingList;
        this.homeInfoList = response.data.homeList;
        this.receivableInfoList = response.data.receivableList;
        this.loading = false;
      });
    },
    /**
     * 支付
     * */
    orderpay() {
      this.dialogVisiblePay=true;

    },
    zf(){
      if(this.payFormData.wayCode=="ALI_PC"){
        this.pc();
      }else if(this.payFormData.wayCode=="ALI_QR"){
        this.qr();
      }
    },

    pc(){
      pay(this.payFormData).then(response=>{
        console.log(response)
        window.open(response.data.data.payData);

      });
    },

    qr(){
      this.dialogVisiblePayqr = true;
      pay(this.payFormData).then(response=>{
        console.log(response);
        this.payQr = response.data.data.payData;
        // 监听响应结果
        this.payOrderWebSocket = new ReconnectingWebSocket('ws://43.142.52.7:9218/api/anon/ws/payOrder/' + response.data.data.payOrderId + '/' + new Date().getTime())
        this.payOrderWebSocket.onopen = () => {}
        this.payOrderWebSocket.onmessage = (msgObject) => {
          const resMsgObject = JSON.parse(msgObject.data)
          if (resMsgObject.state === 2) {
            this.dialogVisiblePay = false;
            this.$message.success("支付成功")
          } else {
            this.dialogVisiblePay = false;
            this.$message.error("支付失败")
          }
        }
      });
    },
    /**
     * 提交租房分期产品
     * */
    productSubmit(){
      this.form.jrProductType=1;
      addProduct(this.form).then(response => {
        this.msgSuccess("操作成功");
        this.dialogFormVisibleRentalInstallment=false;
        this.getList();
      });

    },
    /**
     * 打开修改租房分期产品
     * */
    updateProduct(val){
      this.form=val;
      console.log(this.form)
      this.dialogFormVisibleRentalInstallment=true;
    },


    /**
     * 查看租房分期详情
     * */
    reloadProduct(val){
      this.form=val;
      this.reloadDialogFormVisibleRentalInstallment=true;

    },


    /**
     * 提交收房贷
     * */
    housingLoanCollectionSubmit(){
      this.housingLoanCollection.jrProductType=2;

      addProduct(this.housingLoanCollection).then(response => {
        this.msgSuccess("操作成功");
        this.dialogFormVisibleHousingLoanCollection=false;
        this.getList();
      });
    },

    /**
     * 打开修改收房贷
     * */
    updateHomeInfoList(val){
      this.housingLoanCollection=val;
      this.dialogFormVisibleHousingLoanCollection=true;
    },


    /**
     * 查看收房贷
     * */
    reloadHomeInfoList(val){
      this.housingLoanCollection=val;
      this.reloadDialogFormVisibleHousingLoanCollection=true;
    },


    /**
     * 提交应收租约保理
     * */
    leaseFactoringReceivableSubmit(){
      this.leaseFactoringReceivable.jrProductType=3;
      addProduct(this.leaseFactoringReceivable).then(response => {
        this.msgSuccess("操作成功");
        this.dialogFormVisibleaddLeaseFactoringReceivable=false;
        this.getList();
      });
    },

    /**
     * 查看应收租约保理
     * */
    reloadReceivableInfoList(val){
      this.receivableInfoList=val;
      this.reloadDialogFormVisibleLeaseFactoringReceivable=true;
    },


    /**
     * 打开修改应收租约保理
     * */
    updateReceivableInfoList(val){
      this.receivableInfoList=val;
      this.dialogFormVisibleaddLeaseFactoringReceivable=true;
    },

    /**
     * 作废软删除
     * @param selection
     */
    voidSoftDelete(val){
      this.$confirm('此操作作废该条, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
      delProduct(val).then(response => {
          this.$message.success("作废成功")
          this.rentList();
      });
    },
    /**
     * 添加
     * @param selection
     */
    addRentalInstallment(){
    this.dialogFormVisibleRentalInstallment=true;
    },
    addHousingLoanCollection(){
    this.dialogFormVisibleHousingLoanCollection=true;
    },
    addLeaseFactoringReceivable(){
      this.dialogFormVisibleaddLeaseFactoringReceivable=true;
    },

    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },

    accountType(){
      this.status=1;
    },
    //查询地区省
    getProvince(){

      provinceList().then(response => {
      this.province=response.data;
      });
    },
    //查询银行
    getBank(){

      getBankList().then(response => {
        this.BankList=response.data;
      });
    }



  }
};
</script>
